#include <iostream>  
#include <semaphore.h>  
#include <sys/wait.h>  
#include <unistd.h>  
#include <fcntl.h>  
#include <sys/stat.h>  
#include<Recorder.h>
int main() {  
    pid_t pid;
    pid = fork();
    if(pid == -1)//错误创建
    {
        perror("fork error");
        _exit(1);
    }
    else if(pid == 0)//子进程
    {
        //cout<<"i am child,pid = "<<getpid()<<" my parent is:"<<getppid()<<endl;
        Recorder* t = new Recorder("/home/gk/Desktop/pe_test2/outputfile");
        for(int i = 0; i <10; i++){
            t->teset1(getpid());
        }
        delete t;
        return 0;
    }

    Recorder* t2 = new Recorder("/home/gk/Desktop/pe_test2/outputfile");
    for(int i = 0; i <10; i++){
        t2->teset2(pid);
    }
    delete t2;
    return 0;  
}